%{
#include<stdio.h>
int num_lines = 0, num_chars = 0;
%}
%%
\n { ++ num_lines ; ++ num_chars ; }
.  { ++ num_chars ; }

%%
int main () {
yylex ();
printf ( "# of l ine s = %d, # of chars = %dnn",
num_lines , num_chars );
}